<!DOCTYPE html>
<html>
<head>
	
	<title><?php echo _MANAGER_TITLE_; ?></title>

	<?php $this->setFlag('list,vue'); ?>
	<?php $this->import('meta'); ?>

	<link rel="stylesheet" type="text/css" href="html/manager/record/css/autolog.css" />

    <script type="text/javascript" src="html/manager/record/js/autolog.js"></script>

</head>
<body>

	<div id="mainBg" class="bg" style="display: none;">

		<input type="text" id="channelInfo" class="display-none" />
        <input type="text" id="moduleInfo" class="display-none" />
        <input type="text" id="operaterInfo" class="display-none" />
        <input type="text" id="statusInfo" class="display-none" />
        <input type="text" id="selectid" class="display-none" />
        <input type="text" id="tempid" class="display-none" />
        <input type="text" id="menuid" class="display-none" />

        <div class="title-bar2">
            <div class="title2">自动化日志</div>
            <button id="deleteMoreBtn" type="button" class="layui-btn layui-btn-danger btnDel" style="display: none;" onclick="deleteMoreAutolog()">批量删除</button>
        </div>

        <div class="options-bar">
            <div class="options-row">
                <div class="options-row-left">功能模块：</div>
                <div id="moduleOptions" class="options-row-right">
                </div>
            </div>
            <div class="options-row2">
                <div class="options-row-left">操作渠道：</div>
                <div class="options-row-right">
                    <div class="options-item-selected" onclick="selectOneOption(this, '', 'channelInfo')">全部</div>
                    <div class="options-item" onclick="selectOneOption(this, '0', 'channelInfo')">自动化客户端</div>
                    <div class="options-item" onclick="selectOneOption(this, '1', 'channelInfo')">运营后台</div>
                </div>
            </div>
            <div class="options-row2">
                <div class="options-row-left">操作员：</div>
                <div id="operaterOptions" class="options-row-right">
                </div>
            </div>
            <div class="options-row2">
                <div class="options-row-left">状态：</div>
                <div class="options-row-right">
                    <div class="options-item-selected" onclick="selectOneOption(this, '', 'statusInfo')">全部</div>
                    <div class="options-item" onclick="selectOneOption(this, '0', 'statusInfo')">正在执行中</div>
                    <div class="options-item" onclick="selectOneOption(this, '1', 'statusInfo')">成功</div>
                    <div class="options-item" onclick="selectOneOption(this, '2', 'statusInfo')">失败</div>
                    <div class="options-item" onclick="selectOneOption(this, '3', 'statusInfo')">强制中止</div>
                </div>
            </div>
            <div class="options-row2">
                <div class="options-row-left">操作时间：</div>
                <div class="options-row-right">
                    <div class="options-text">从</div>
                    <input type="text" id="startdate" class="options-input1" placeholder="起始时间" readonly="readonly" autocomplete="off" />
                    <div class="options-text">至</div>
                    <input type="text" id="enddate" class="options-input1" placeholder="结束时间" readonly="readonly" autocomplete="off" />
                </div>
            </div>
        </div>

        <div class="tongji-bar">
            <span class="tongji">共<span id="listCount" class="tc1">0</span>条日志</span>
        </div>

        <div id="listBar" class="table-bar">
            <table class="table-box">
                <tr class="tr-head">
                    <td class="td-head hw0"><input type="checkbox" name="allSelect" onclick="selectAll(this)" /></td>
                    <td class="td-head">操作内容</td>
                    <td class="td-head hw5">操作渠道</td>
                    <td class="td-head hw3">操作员</td>
                    <td class="td-head hw3">状态</td>
                    <td class="td-head hw6">执行结果</td>
                    <td class="td-head hw2">操作</td>
                </tr>
                <tr class="tr-item" v-for="info in list">
                    <td class="td-item-center hw0"><input type="checkbox" name="isSelect" v-bind:value="info.logid" onclick="selectOne()" /></td>
                    <td class="td-item-left">
                        <span class="tview" v-on:click="viewAutolog(info.logid)">{{ info.starttime }} ~ {{ info.endtime.split(' ')[1] }}【{{ info.module }}】</span>
                    </td>
                    <td class="td-item-center hw5">
                        <template v-if="info.channel == '0'">自动化客户端</template>
                        <template v-else>运营后台</template>
                    </td>
                    <td class="td-item-center hw3">{{ info.operater }}</td>
                    <td class="td-item-center hw3">
                        <template v-if="info.status == '0'"><span class="tc5">正在执行中</span></template>
                        <template v-else-if="info.status == '1'"><span class="tc2">成功</span></template>
                        <template v-else-if="info.status == '2'"><span class="tc1">失败</span></template>
                        <template v-else-if="info.status == '3'"><span class="tc1">强制中止</span></template>
                        <template v-else-if="info.status == '4'"><span class="tc5">已修复</span></template>
                        <template v-else><span class="tc3">状态异常</span></template>
                    </td>
                    <td class="td-item-center hw6">
                        <template v-if="info.status == '1'"><span class="tc2">{{ info.result }}</span></template>
                        <template v-else-if="info.status == '2'"><span class="tc1">{{ info.result }}</span></template>
                        <template v-else><span class="tc3">{{ info.result }}</span></template>
                    </td>
                    <td class="td-item-center hw2">
                    	<template v-if="permission.handlelog == 'yes'">
                    		<template v-if="info.status == '0'">
	                            <span class="item-stop" v-on:click="stopAutolog(info.logid)">中止</span>
	                        </template>
	                        <template v-else-if="info.status == '2'">
	                            <span class="item-edit" v-on:click="repairAutolog(info.logid)">修复</span>
	                        </template>
                    	</template>
                        <template v-if="permission.deleteinfo == 'yes'">
                        	<span class="item-delete" v-on:click="deleteAutolog(info.logid)">删除</span>
                        </template>
                    </td>
                </tr>
            </table>
        </div>

        <?php $this->import('page'); ?>
        <?php $this->import('options'); ?>
        <?php $this->import('slipiframe'); ?>

        <script type="text/javascript">
            var autolog = new Vue({
                el: '#listBar',
                data: {
                    list: '',
                    permission: ''
                }
            });

            layui.use('laydate', function(){
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#startdate',
                    done: function(value, date, endDate) {
                        queryKey('ok');
                    }
                });
                laydate.render({
                    elem: '#enddate',
                    done: function(value, date, endDate) {
                        queryKey('ok');
                    }
                });
            });
        </script>

	</div>

</body>
</html>